<?php

namespace App\Handlers;
use Mail;

class SendEmailHandler
{
    public function send($action,$email,$email_code)
    {
        $view = 'emails.'.$action;
        $from = 'zhuleilove12@126.com';
        $name = 'Lshop';
        $to = $email;
        $subject = "感谢使用此应用！";
        $data = ['email_code' => $email_code];

        Mail::send($view, $data, function ($message) use ($from, $name, $to, $subject) {
            $message->from($from, $name)->to($to)->subject($subject);
        });
    }
}
